<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>player</title>
  <link href="//vjs.zencdn.net/7.0/video-js.min.css" rel="stylesheet">
</head>
<body>
  <input type="text" id="inputSrc" />
  <button id="btn">设置</button>
  <p></p>
  <video
    id="my-player"
    class="video-js"
    controls
    preload="auto"
    data-setup='{}'>
    <!-- <source src="movie/movie.m3u8"></source> -->
    <source src="live/test.flv" type='video/x-flv'>
    <!-- <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source> -->
    <!-- <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"></source> -->
    <!-- <source src="//vjs.zencdn.net/v/oceans.ogv" type="video/ogg"></source> -->
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a
      web browser that
      <a href="http://videojs.com/html5-video-support/" target="_blank">
        supports HTML5 video
      </a>
    </p>
  </video>
  <script src="https://cdn.bootcss.com/video.js/7.0.3/video.min.js"></script>
  <script src="https://cdn.bootcss.com/flv.js/1.4.2/flv.min.js"></script>
  <script src="https://unpkg.com/videojs-flvjs@0.2.0/dist/videojs-flvjs.min.js"></script>
  <script type="text/javascript">
    var player = videojs('my-player', {
      techOrder: ['html5', 'flvjs'],
      flvjs: {
      mediaDataSource: {
          isLive: false,
          cors: true,
          withCredentials: false,
        }
      },
    });
    btn.onclick = function () {
      player.src(inputSrc.value)
    }
  </script>
</body>
</html>